Skip to content

Conversation

@kchibisov
Copy link
Member

cc @madsmtm @daxpedda

That's approach with &mut dyn, it does require as_any method implemented by the user, but I guess it's fine?


fn primary_monitor(&self) -> Option<MonitorId>;

fn as_any(&mut self) -> &mut dyn Any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not possible?

Suggested change
fn as_any(&mut self) -> &mut dyn Any;
fn as_any(&mut self) -> &mut dyn Any {
self
}

What if we add Window: Any to the trait itself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's not, because it'll require sized and it's not object safe, etc. it's not really a big issue though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try to pull my code and play with it, but it wasn't really working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants